package com.jxsd.edu.cn.struts2.intercept;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class EncoderIntercepter extends  AbstractInterceptor 
{
   
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private  String  Encoding;
	
	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		HttpServletRequest  request=ServletActionContext.getRequest();
		
		request.setCharacterEncoding(Encoding);
		
		return invocation.invoke();
	}

	public String getEncoding() {
		return Encoding;
	}

	public void setEncoding(String encoding) {
		Encoding = encoding;
	}
  
}
